import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

//引入框架
import Layout from '@/layout/Layout.vue'
const routes = [{
        path: '/login',
        component: () =>
            import ('@/views/login/index.vue'),
    }, {
        path: '/',
        redirect: 'home',
    },
    {
        path: '/home',
        redirect: '/home/goods',
        component: Layout,
        children: [{
                path: '/home/goods',
                component: () =>
                    import ('@/views/goods'),
            },
            {
                path: '/home/comment',
                component: () =>
                    import ('@/views/comment'),
            },
            {
                path: '/home/shop',
                component: () =>
                    import ('@/views/shop'),
            },
        ],
    },
    {
        path: '/detail',
        component: () =>
            import ('@/views/detail')
    },
]
const router = new VueRouter({
    routes,
})
export default router